<?php defined('APP_PATH') or exit('Access Denied');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理员列表</title>
<link rel="stylesheet" type="text/css" href="vonuo/static/css/vonuo.css">
<script type="text/javascript" src="vonuo/static/js/jquery.min.js"></script>
<script type="text/javascript" src="vonuo/static/js/tablecolor.js"></script>
<script type="text/javascript">
function updst(){
	var i = 0;
	$("input[name='id[]']").each(function(){
		if($(this).attr('checked')){
			i++;
		}
	});
	if(i == 0){
		alert('请选择要切换状态的编号');
		return false;
	}
	if(confirm('确定切换状态？')){
		$('form').submit();
	}else{
		return false;
	}
}
</script>
</head>

<body>
<div class="gs_wraper gs_p_l0">
	<div class="tab_box">
		<table width="100%" style="margin-top:10px;" border="0" cellpadding="0" cellspacing="0"  class="common_table">
			<tr>
				<th width="70"><input type="checkbox" onclick="$('.all_check').attr('checked',$(this).attr('checked'))" class="all_check" /><label>编号</label></th>
				<th width="100">管理员账号</th><th width="100">管理员姓名</th><th width="100">所属管理组</th><th width="60">状态</th><th width="100">添加时间</th><th width="100">管理员设置</th>
			</tr>
			<form action="<?php echo spUrl('admin','updst');?>" method="post">
			<?php foreach($admin as $row){?>
			<tr>
				<td><input name="id[]" type="checkbox" value="<?php echo $row['id'];?>" class="all_check" /><label><?php echo $row['id'];?></label></td>
				<td><?php echo $row['code'];?></td><td><?php echo $row['name'];?></td><td><?php if($row['root']==1){echo '创始人组';}else{echo $row['group']['name'];}?></td>
				<td><?php if($row['status']==1){?>正常<?php }else{?><span style="color:red;">禁用</span><?php }?></td><td><?php echo date('Y-m-d H:i:s', $row['time']);?></td>
				<td><?php if($row['root']==1){?>[禁止操作]<?php }else{?>
					<a href="<?php echo spUrl('admin','upd',array('id'=>$row['id']));?>">[编辑]</a>
					<a href="<?php echo spUrl('admin','del',array('id'=>$row['id']));?>" onclick="return confirm('确定删除？');">[删除]</a>
				<?php }?></td>
			</tr>
			<?php }?>
			</form>
			<tr class="bottom">
				<td colspan="7" align="left" valign="middle">
					<a href="javascript:;" onclick="updst();" class="btn_wei f_left">切换状态</a>
				</td>
			</tr>
  		</table>
	</div>
</div>
</body>
</html>